package com.atguigu.day10;

public class Test13 {
    public static void main(String[] args) {
        final int EMPLOYEE = 10;//表示普通员工
        final int PROGRAMMER = 11;//表示程序员
        final int DESIGNER = 12;//表示设计师
        final int ARCHITECT = 13;//表示架构师

        String[][] EMPLOYEES = {
                {"10", "1", "段誉", "22", "3000"},
                {"13", "2", "令狐冲", "32", "18000", "15000", "2000"},
                {"11", "3", "任我行", "23", "7000"},
                {"11", "4", "张三丰", "24", "7300"},
                {"12", "5", "周芷若", "28", "10000", "5000"},
                {"11", "6", "赵敏", "22", "6800"},
                {"12", "7", "张无忌", "29", "10800","5200"},
                {"13", "8", "韦小宝", "30", "19800", "15000", "2500"},
                {"12", "9", "杨过", "26", "9800", "5500"},
                {"11", "10", "小龙女", "21", "6600"},
                {"11", "11", "郭靖", "25", "7100"},
                {"12", "12", "黄蓉", "27", "9600", "4800"}
        };
        Employee[] e =new Employee[EMPLOYEES.length];
//        System.out.println(EMPLOYEES[0].getInfo());
//        System.out.println(EMPLOYEES[1].getInfo());
//        System.out.println(EMPLOYEES[2].getInfo());
        for (int i = 0; i < EMPLOYEES.length; i++) {
            int type = Integer.parseInt(EMPLOYEES[i][0]);
            switch (Integer.parseInt(EMPLOYEES[i][0])){

                case 10:
                    e[i] = new Employee();
                    break;
                case 11:
                    e[i] = new Programmer();
                    break;
                case 12:
                    e[i] = new Designer();
                    break;
                case 13:
                    e[i] = new Architect();
                    break;
                default:
                    break;
            }
            e[i].setId(Integer.parseInt(EMPLOYEES[i][1]));
            e[i].setName(EMPLOYEES[i][2]);
            e[i].setAge(Integer.parseInt(EMPLOYEES[i][3]));
            e[i].setSalary(Double.parseDouble(EMPLOYEES[i][4]));

        }
        System.out.println("编号\t姓名\t年龄\t薪资\t语言\t奖金\t股票");
        for (int i = 0; i < e.length; i++) {
            System.out.println(e[i].getInfo());
        }
        }

    }

class Employee{

    private int id;
    private String name;
    private int age;
    private double salary;

    public Employee() {
    }

    public Employee(int id, String name, int age, double salary) {
        this.id = id;
        this.name = name;
        this.age = age;
        this.salary = salary;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public double getSalary() {
        return salary;
    }

    public void setSalary(double salary) {
        this.salary = salary;
    }
    public String getInfo(){
        return "编号:"+id+",姓名:"+name+",年龄:"+age+",薪资:"+salary;
    }
}
class Programmer extends Employee {
    public Programmer(Employee employee, String useLanguage) {
        super(employee.getId(), employee.getName(), employee.getAge(), employee.getSalary());
        this.useLanguage = useLanguage;
    }

    private String useLanguage = "java";

    public Programmer() {
    }

    public Programmer(String useLanguage) {
        this.useLanguage = useLanguage;
    }

    public String getUseLanguage() {
        return useLanguage;
    }

    public void setUseLanguage(String useLanguage) {
        this.useLanguage = useLanguage;
    }
    public String getInfo(){
        return super.getInfo()+",编程语言:"+useLanguage;
    }
}
class Designer extends Programmer {
    public Designer(Employee employee, String useLanguage, double bonus) {
        super(employee, useLanguage);
        this.bonus = bonus;
    }

    private double bonus;

    public Designer() {
    }

    public Designer(double bonus) {
        this.bonus = bonus;
    }

    public double getBonus() {
        return bonus;
    }

    public void setBonus(double bonus) {
        this.bonus = bonus;
    }
    public String getInfo(){
        return super.getInfo()+",奖金:"+bonus;
    }
}
class Architect extends Designer {
    public Architect(Employee employee, String useLanguage, double bonus, double stockNums) {
        super(employee, useLanguage, bonus);
        this.stockNums = stockNums;
    }



    private double stockNums;

    public Architect() {
    }

    public Architect(double stockNums) {
        this.stockNums = stockNums;
    }

    public double getStockNums() {
        return stockNums;
    }

    public void setStockNums(double stockNums) {
        this.stockNums = stockNums;
    }
    public String getInfo(){
        return super.getInfo()+",持有股票数量:"+stockNums;
    }
}

